<?php
class RegisterController extends BaseController
{
    public function indexAction(){
        \TC\Di\Container::set('service',[
            'class'  => 'TC\Sdk\Service',
            'redis'  =>  \TC\Di\Container::get('redis')
        ]);
        $service = \TC\Di\Container::get('service');
        $config=[  //学生  => 梦工厂，资源王国，学习记录，象牙塔
            'a'=>'http://127.0.0.1:8001/a',
            'b'=>'http://127.0.0.1:8001/b',
            'c'=>'http://127.0.0.1:8081/c',
            'd'=>'http://127.0.0.1:8081/d',
            ];
        foreach($config as $key=>$con){
            $service->register($key,[
                'class'     => "\TC\Client\Yar",
                'address'   => $con,
            ]);
        }
        return \TC\IO\Output::OverSuccess(['rpc_status'=>1,'msg'=>'注册成功']);
    }
}